{
 "cells": [
  {
   "cell_type": "raw",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_bnh:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## BNH\n",
    "\n",
    "Binh and Korn defined the following test problem in <cite data-cite=\"bnh\"></cite> with 2 objectives and 2 constraints:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Definition**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\\begin{equation}\n",
    "\\newcommand{\\boldx}{\\mathbf{x}}\n",
    "\\begin{array}\n",
    "\\mbox{Minimize} & f_1(\\boldx) = 4x_1^2 + 4x_2^2, \\\\\n",
    "\\mbox{Minimize} & f_2(\\boldx) = (x_1-5)^2 + (x_2-5)^2,    \\\\\n",
    "\\mbox{subject to} & C_1(\\boldx) \\equiv (x_1-5)^2 + x_2^2 \\leq 25, \\\\\n",
    "& C_2(\\boldx) \\equiv (x_1-8)^2 + (x_2+3)^2 \\geq 7.7, \\\\\n",
    "& 0 \\leq x_1 \\leq 5, \\\\\n",
    "& 0 \\leq x_2 \\leq 3.\n",
    "\\end{array}\n",
    "\\end{equation}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Optimum**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The Pareto-optimal solutions are constituted by solutions \n",
    "$x_1^{\\ast}=x_2^{\\ast} \\in [0,3]$ and $x_1^{\\ast} \\in [3,5]$,\n",
    "$x_2^{\\ast}=3$. These solutions are marked by using bold \n",
    "continuous\n",
    "curves.  The addition of both constraints in the problem does not make any solution\n",
    "in the unconstrained Pareto-optimal front infeasible. \n",
    "Thus, constraints may not introduce any additional difficulty\n",
    "in solving this problem."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Plot**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems import get_problem\n",
    "from pymoo.util.plotting import plot\n",
    "\n",
    "problem = get_problem(\"bnh\")\n",
    "plot(problem.pareto_front(), no_fill=True)"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
